<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Access-Control-Allow-Origin" content="*">
<meta property="wb:webmaster" content="2edcaf20d165cca2" />
<title>发送邮件</title>
<script src="../../../../js/jquery-1.3.1.js" type="text/javascript"></script>
<script src="../../../../js/cookie.js" type="text/javascript"></script>
<script type="text/javascript">
		function send(){
		alert('ok!');
			 $.ajax({
				type:"POST", // 也可以改成 POST
				async:false, //
				cache:false, //
				url:"https://13660569061:900110@api.weibo.com/2/statuses/update.json",
				data:{source:'2575049723',status:'测试',uids:'1883369085'},   
				success:function(msg)// msg是receive.php返回的信息
				{     // 如果提交成功可以在这进行一些后续操作  

					alert(msg);
				}   
			 }); 
		}
	</script>
</head>
<body>
	<input type="button" name="send" value="send" onClick="send()"/>
	<br/>
</body>
</html>
<?php
session_start();

include_once( 'config.php' );

	$user = array();
	$arr = array();
	
	$user['$user_name'] = array('username'=>user_name,'pwd'=>pwd,'key'=>WB_AKEY);//这里可以添加多用户调用，每行一个
	$count = isset($_GET['count']) && $_GET['count'] ? intval($_GET['count']) : 20;//调用条数
	$count = $count ? $count : 20;
	
foreach($user as $u){
	$getjson = 'https://'.$u['username'].':'.$u['pwd'].'@api.weibo.com/2/statuses/public_timeline.json?source='.$u['key'].'&count='.$count.'&uids=1883369085';//新浪api
	echo 'getjson:'.$getjson.'<br/>';
	$content = file_get_contents($getjson); //自制函数,远程调用
	$weibo = json_decode($content, true);
	$arr = $weibo['statuses'];
	
}

for($i=0;$i<$count;$i++){
$arr1 = $arr["$i"];
if($arr1) {
$content=$arr1['text'];
echo $content.'<br/>';
}
}

 function file_get_contents_curl($url) {
      $ch = curl_init();
      curl_setopt($ch, CURLOPT_HEADER, 0);
      curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); //Set curl to return the data instead of printing it to the browser.
      curl_setopt($ch, CURLOPT_URL, $url);
      $data = curl_exec($ch);
      curl_close($ch);
      return $data;
      }
?>